<template>
  <van-nav-bar title="分销会员" left-text="" left-arrow @click-left="goBack" />
  <div id="teacherlist" style="height: 82%">
    <div class="list">
      <div v-for="item in member" class="item">
        <a href="javascript:void(0)">
          <div class="avatar">
            <van-image
              round
              width="10rem"
              height="10rem"
              :src="item.avatar_text"
            />
          </div>
          <div class="info">
            <h1 class="title">{{ item.nickname }}</h1>
            <p class="course">性别： {{ item.gender_text }}</p>
            <p class="job">地区： {{ item.province_text }}</p>
            <p class="job">
              认证状态： {{ item.auth == "1" ? "认证" : "未认证" }}
            </p>
            <p class="content">注册时间：{{ item.createtime }}</p>
          </div>
        </a>
      </div>
    </div>
  </div>
  <div v-if="member == []" style="margin: auto;">没有分销会员</div>
</template>

<script setup>
const { proxy } = getCurrentInstance();
const LoginUser = reactive(
  proxy.$cookies.get("LoginUser") ? proxy.$cookies.get("LoginUser") : {}
);
const goBack = () => {
  proxy.$router.push("/business/index");
};
const member = ref([]);

onBeforeMount(() => {
  getMemberData();
});
const getMemberData = async () => {
  let result = await Api.membership({
    busid: LoginUser.id,
  });
  if (result.code == 1) {
    member.value = result.data;
  }
};
</script>
<style scoped>
@import url("/assets/css/membership.css");
</style>
